<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../resource/img/jquery-1.8.3.js"></script>
<!--   导入validate  -->
    <script src="../resource/img/jquery.validate.min.js"></script>
<!--    导入中文-->
    <script src="../resource/img/messages_zh.js"></script>
    <script>
        $(function () {
            $("#checkform").validate({
                rules:{
                    username:{
                        required:true,
                        minlength:6
                    },
                    password:{
                        required: true,
                        minlength: 5
                    },

                },
                messages:{
                    username:{
                        required:"梁家杰傻逼",
                        minlength:"哪能少于6位嘛"
                    },
                    password:{
                        required: "就是不换手机",
                        minlength: "傻逼梁家杰"
                    }
                }
            });
        })
    </script>
</head>
<body>
        <form action="#" id="checkform">
            用户名 <input type="text" name="username"><br>
            密码 <input type="password" name="password"><br>
            <input type="submit" value="注册">
        </form>
</body>
</html>